<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title></title>
    <%@ include file="/WEB-INF/views/include/easyui.jsp" %>
    <script src="${ctx}/static/plugins/My97DatePicker/WdatePicker.js" type="text/javascript"></script>

</head>
<body style="font-family: '微软雅黑'">
<div id="tb" style="padding:5px;height:auto">
    <div>
        <form id="searchFrom" action="">
            <input type="text" name="filter_LIKES_label" class="easyui-validatebox"
                   data-options="width:150,prompt: '标签'"/>
            <input type="text" name="filter_LIKES_value" class="easyui-validatebox"
                   data-options="width:150,prompt: '值'"/>
            <input type="text" name="filter_LIKES_type" class="easyui-validatebox"
                   data-options="width:150,prompt: '类型'"/>
            <span class="toolbar-item dialog-tool-separator"></span>
            <a href="javascript(0)" class="easyui-linkbutton" plain="true" iconCls="icon-search" onclick="cx()">查询</a>
        </form>
    </div>

</div>
<table id="popupDg"></table>
<script type="text/javascript">
    var dg;
    $(function () {
        <%--$.ajax({--%>
            <%--type:'get',--%>
            <%--url:'${ctx}/shop/goodsListPopup/json',--%>
            <%--success: function(data){--%>
                <%--debugger;--%>
                <%--$('#dg').datagrid('loadData', data.rows);--%>
            <%--}--%>
        <%--});--%>

        dg = $('#popupDg').datagrid({
            method: "get",
            url: '${ctx}/shop/goodsListPopup/json',
            fit: true,
            fitColumns: true,
            border: false,
            striped: true,
            idField: 'id',
            pagination: true,
            rownumbers: true,
            pageNumber: 1,
            pageSize: 20,
            pageList: [10, 20, 30, 40, 50],
            singleSelect: true,
            columns: [[
                {field: 'id', title: 'id', hidden: true},
                {field: 'name', title: '名称', sortable: true, width: 100},
                {field: 'cover', title: '封面', sortable: true, width: 100},
                {field: 'price', title: '价格', sortable: true, width: 100},
                {field: 'isSold', title: '是否上架', sortable: true},
                {field: 'sales', title: '销量', sortable: true, width: 100},
                {field: 'postage', title: '邮费', sortable: true},
                {field: 'pv', title: '浏览量', sortable: true}
            ]],
            enableHeaderClickMenu: false,
            enableHeaderContextMenu: false,
            enableRowContextMenu: false,
            toolbar: '#tb',
            onDblClickRow: function(rowIndex, rowData){
                convert2ObjBean(rowData) ;//单个对象 字段 数据库类型 转bean   数组对象 转 convert2BeanList(data
                returnVal2ParentDialog(rowData);
                dialogId.dialog('close');
            }
        });
        dialogId.panel('resize', {width:dialogRewidth, height:dialogReheight});
        dialogDg = dg;
    });

    //创建查询对象并查询
    function cx() {
        var obj = $("#searchFrom").serializeObject();
        dg.datagrid('reload', obj);
    }

</script>
</body>
</html>